<body>
<{$xajax_scripts}> 
<div class=form_title><{$smarty.const.MI_SEARCH_INPUT_CONDITIONS}></div>
<form method='get' onsubmit='return check_search_keys();'>
<script>

function ServerSync_RefreshLotList()
{
    if (document.getElementById("kit_id").value != '')
        xajax_Ajax_RefreshLotList(document.getElementById("kit_id").value);
    else
        document.getElementById('lot_no').options.length=1;
}

function check_search_keys()
{
    if (document.getElementById('genotypes').value == '' &&
        document.getElementById('sample_id').value == '' &&
        document.getElementById('kit_id').value == '' &&
        document.getElementById('lot_no').value == '' &&
        document.getElementById('institution').value == '' &&
        document.getElementById('proc_status').value == 'ANY' &&
        document.getElementById('patient_id').value == '' &&
        document.getElementById('name').value == '')
    {
        if (confirm('<{$smarty.const.MI_NO_SEARCH_KEYS_CONFIRM}>'))
            return true;
        else
            return false;
    }

    return true;
}

</script>
<input type='hidden' name='op' value='search'>
  <table width="50%" border='1' align="center" cellpadding='1' cellspacing='1' bordercolor="#157fb9" class=form_detail>
    <tr bordercolor="#cbe5f6"> 
      <td nowrap background='<{$theme_url}>/images/form_detail_pic03.jpg' style="color: black; font-size: 8pt; text-align: right; font-weight: bold;"><{$smarty.const.MI_GENOTYPES}></td>
      <td colspan=3> <input type='text' size="60" maxlength=120 name='genotypes' value='<{$genotypes}>' /> 
        <div class=field_hint><{$smarty.const.MI_GENOTYPES_SEARCH_HINT}></div></td>
    </tr>
    <tr bordercolor="#cbe5f6"> 
      <td nowrap background='<{$theme_url}>/images/form_detail_pic03.jpg' style="color: black; font-size: 8pt; text-align: right; font-weight: bold;"><{$smarty.const.MI_SAMPLE_ID}></td>
      <td colspan=3> <input type='text' size="60" maxlength=90 name='sample_id' value='<{$sample_id}>'>
        <br/> <div class=field_hint><{$smarty.const.MI_SAMPLE_ID_SEARCH_HINT}></div></td>
    </tr>
    <tr bordercolor="#cbe5f6"> 
      <th nowrap background='<{$theme_url}>/images/form_detail_pic03.jpg' style="color: black; font-size: 8pt; text-align: right; font-weight: bold;"><{$smarty.const.MI_SELECT_KIT_ID}></th>
      <td> <select name='kit_id' onchange='ServerSync_RefreshLotList();'>
          <option></option><{foreach from=$kit_id_list key=kit_id item=kit_desc }> <option value='<{$kit_id}>'<{if $kit_id==$current_kit_id }> selected<{/if}>><{$kit_id}> - <{$kit_desc}></option> <{/foreach}> 
        </select></td>
      <th nowrap background='<{$theme_url}>/images/form_detail_pic03.jpg' style="color: black; font-size: 8pt; text-align: right; font-weight: bold;"><{$smarty.const.MI_TEST_BY2}></th>
      <td> <select name='test_by'>
          <option></option><{foreach from=$test_by_list item=line}>
          <option<{if $test_by==$line.test_by}> selected<{/if}>><{$line.test_by}></option> <{/foreach}> 
        </select></td>
    </tr>
    <tr bordercolor="#cbe5f6"> 
      <th nowrap background="<{$theme_url}>/images/form_detail_pic03.jpg" style="color: black; font-size: 8pt; text-align: right; font-weight: bold;"><{$smarty.const.MI_PROC_STATUS}></th>
      <td><select name="proc_status"><option value="ANY" <{if $proc_status=='ANY'}>selected<{/if}>><{$smarty.const._ANY}></option><option value="Y" <{if $proc_status=='Y'}>selected<{/if}>><{$smarty.const.MI_FINAL}></option><option value='N'<{if $proc_status=='N'}> selected<{/if}>><{$smarty.const.MI_UNFINISHED}></option></select></td>
      <th nowrap background='<{$theme_url}>/images/form_detail_pic03.jpg' style="color: black; font-size: 8pt; text-align: right; font-weight: bold;"><{$smarty.const.MI_KIT_LOT_NO}></th>
      <td> <select name='lot_no'>
          <option></option>
        </select></td>
    </tr>
    <tr bordercolor="#cbe5f6" style="display:none;"> 
      <th nowrap background='<{$theme_url}>/images/form_detail_pic03.jpg' style="color: black; font-size: 8pt; text-align: right; font-weight: bold; display: none;"><{$smarty.const.MI_INSTITUTION}></th>
      <td colspan="3"> <select name='institution'>
          <option></option><{foreach from=$institution_list item=line}>
          <option<{if $institution==$line}> selected<{/if}>><{$line}></option> <{/foreach}> 
        </select></td>
    </tr>
    <tr bordercolor="#cbe5f6"> 
      <th nowrap background='<{$theme_url}>/images/form_detail_pic03.jpg' style="color: black; font-size: 8pt; text-align: right; font-weight: bold;"><{$smarty.const.MI_PATIENT_ID}></th>
      <td> <input type='text' size="20" maxlength=50 name='patient_id' value='<{$patient_id}>'></td>
      <th nowrap background='<{$theme_url}>/images/form_detail_pic03.jpg' style="color: black; font-size: 8pt; text-align: right; font-weight: bold;"><{$smarty.const.MI_NAME}></th>
      <td> <input type='text' size="20" maxlength=50 name='name' value='<{$name}>'></td>
    </tr>
  </table>  
  <br>
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td align="center">
<input name="submit" type='submit' class='btn_search' value="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<{$smarty.const.MI_SEARCH}>" /> 
        <input name="button" type='button' class='btn_clear' onClick='location.href="/search.php";' value="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<{$smarty.const._CLEAR}>" /></td>
    </tr>
  </table>
</form>
<br/>
<div class=form_title><{$smarty.const.MI_SAMPLES_SEARCH_RESULT}> - <{$smarty.const.MI_RESULT_DISPLAY_COUNT}> <{$search_ret_sample_display_count}>/<{$search_ret_sample_max_count}> <{$smarty.const.MI_RESULT_MAX_COUNT}></div>
<{include file='browse.html' browse=$search_ret_sample}>
<br/>
<{if !empty($search_ret_old_sample)}>
<div class=form_title><{$smarty.const.MI_OLD_SAMPLES_SEARCH_RESULT}> - <{$smarty.const.MI_RESULT_DISPLAY_COUNT}> <{$search_ret_old_sample_display_count}>/<{$search_ret_old_sample_max_count}> <{$smarty.const.MI_RESULT_MAX_COUNT}></div>
<{include file='browse.html' browse=$search_ret_old_sample}>
<{/if}>
<script>
    ServerSync_RefreshLotList();
    document.getElementById('genotypes').focus();
</script>
